﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataAccessLayer;
using System.Data.SqlTypes;
using System.Data;


namespace BusinessLayer
{
    public class AddBookings
    {
        
        public string booking_number { get; set; }
        public string payment_method { get; set; }
        public decimal total_amount { get; set; }
        public DateTime booking_date { get; set; }
        public DateTime return_date { get; set; }
        public string description { get; set; }
        public string status { get; set; }
        public Int16 quantity { get; set; }

        public AddBookings()
        {
            booking_number = "";
            payment_method = "";
            total_amount = 0;
            booking_date = DateTime.MaxValue;
            return_date = DateTime.MaxValue;
            description = "";
            status = "";
            quantity = 0;

        }
        public AddBookings(string b_n, string p_m, decimal t_a, DateTime b_date, DateTime r_date, string desc, string sta, Int16 qnt)
        {
            booking_number = b_n;
            payment_method = p_m;
            total_amount = t_a;
            booking_date = b_date;
            return_date = r_date;
            description = desc;
            status = sta;
            quantity = qnt;
        }
        public void save_booking()
        {
            DataAccessLayer.csDAL objdal = new DataAccessLayer.csDAL();
            List<csparameterListType> parlistbooking = new List<csparameterListType>();

            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.VarChar, booking_number));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.VarChar,payment_method));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.Decimal, total_amount));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.DateTime, booking_date));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.DateTime, return_date));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.VarChar, description));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.VarChar, status));
            parlistbooking.Add(new csparameterListType("@", System.Data.SqlDbType.Int, quantity));

            objdal.executespreturndr("SAVE_BOOKING", parlistbooking);
        }
    }
}